package com.gbits.app.finance.convert;

import java.util.List;
import java.util.Map;

import org.springframework.util.StringUtils;

import com.gbits.app.finance.api.FinanceConvert;

public class DefaultSubjectConvert implements FinanceConvert<String> {
	private List<FinanceConvert> filters;
	public List<FinanceConvert> getFilters() {
		return filters;
	}
	public void setFilters(List<FinanceConvert> filters) {
		this.filters = filters;
	}
	public String doConvert(Map<String, Object> map) {
		StringBuffer sb = new StringBuffer();
		for (FinanceConvert fc : this.filters) {
			Object value = fc.doConvert(map);
			if (!StringUtils.isEmpty(value)) {
				sb.append(String.valueOf(value));
				sb.append("\n");
			}
		}
		return sb.toString();
	}

}
